local xuyaozhiliao = fk.CreateSkill{
    name = "rmt__xuyaozhiliao",
    dynamic_desc = function (self, player, lang)
        return "你的武将牌始终播放“救我...”。非当前回合角色回复体力时，"..tostring(math.min(100,30 + player:getLostHp()*10)).."%的概率转移至你（你每损失1点体力，概率增加10%）。"
    end,
}
Fk:loadTranslationTable{
    ["rmt__xuyaozhiliao"] = "需要治疗",
    [":rmt__xuyaozhiliao"] = "你的武将牌始终播放“救我...”。非当前回合角色回复体力时，30%的概率转移至你（你每损失1点体力，概率增加10%）。",
}

xuyaozhiliao:addEffect(fk.PreHpRecover, {
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(xuyaozhiliao.name) and (math.random() < (0.3 + player:getLostHp()*0.1)) and target ~= player and target ~= player.room.current
    end,
    on_cost = Util.TrueFunc,
    on_use = function(self, event, target, player, data)
        if player:isWounded() then
            local num = math.min(player:getLostHp(),data.num)
            player.room:recover{
                who = player,
                num = num,
                skillName = xuyaozhiliao.name,
                recoverBy = target,
            }
        end
        return true
    end,
})

local spec = {
    can_refresh = function (self, event, target, player, data)
        return player:hasSkill(xuyaozhiliao.name)
    end,
    on_refresh = function (self, event, target, player, data)
        player.room:setEmotion(player, "./packages/aaa_Romantic/image/anim/death")
    end,
}

xuyaozhiliao:addEffect(fk.BeforeCardsMove, spec)
xuyaozhiliao:addEffect(fk.BeforeHpChanged, spec)
xuyaozhiliao:addEffect(fk.BeforeRequestAsk, spec)

return xuyaozhiliao